
<%-------------------------------------------------------------------
 * 页面名称：idcardSubmit.jsp
 * 功能描述：提交身份证页面
 * Action  : 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%@ page
	import="cn.agiledata.bank.common.util.WeatherUtil,cn.agiledata.bank.account.dao.hibernate.HibernateAccountDAO,com.vnv.infrastructure.logic.IPBAppFactory,cn.agiledata.bank.hibernateBean.Account,cn.agiledata.bank.common.util.Constant"%>
<%
String path = request.getContextPath();
	Long id = new Long(WeatherUtil.getAccountIdFromSession(request));

	HibernateAccountDAO hd = null;
	try {
		hd = (HibernateAccountDAO) IPBAppFactory.getObj("accountDAO");
	} catch (Exception e) {
		e.printStackTrace();
	}
	Account user = hd.getAccountById(id);
%>
<script type='text/javascript' src='<%=path%>/js/vnv/commonForManage.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/AccountLogic.js'></script>
<script type='text/javascript' src='<%=path%>/js/ufront.js'></script>
<script language="javascript" type="text/javascript"
	src="<%=path%>/js/choiceCity.js"></script>
<script type='text/javascript'
	src='<%=path%>/dwr/interface/accountTemplate.js'></script>
<SCRIPT LANGUAGE="JavaScript">
function submitProcess() {
var formObj = document.IdcardAuthenticateForm;
	if (checkNecessaryInput(formObj)&&checkInputMaxlength(formObj)) {
	if (formObj.accountId.value.length>5 && formObj.accountId.value.length<33) {
				formObj.submit();
			} else {
				alert("有效号码的长度应该在6位到32位之间！");
			}
		
	}
}
function hidePhoto() {
	document.getElementsByName("idcardPhoto")[0].value = "";
	document.getElementsByName("backOfIdcardPhoto")[0].value = "";
	document.getElementById("photoDiv").style.display = "none";
}
function exampleChange(flag) {
	if (flag==1) {
		document.getElementById("example").src = "<%=path%>/images/oldcard.jpg";
		document.getElementById("exampleText").innerText = "第一代身份证样例";
	} else {
		document.getElementById("example").src = "<%=path%>/images/newcard_1.jpg";
		document.getElementById("exampleText").innerText = "第二代身份证样例（正面）";
	}
}
function photoChange(imgObjId, imgSrc) {
	var now = new Date();
	if (imgSrc==""||imgSrc==undefined) imgSrc="<%=path%>/images/noPhoto.gif";
	var imgObj = document.getElementById(imgObjId);
	imgObj.src = imgSrc;
}
function photoChangeback(imgObjId, imgSrc) {
	var now = new Date();
	if (imgSrc==""||imgSrc==undefined) imgSrc="<%=path%>/images/noPhoto.gif";
	var imgObj = document.getElementById(imgObjId);
	imgObj.src = imgSrc;
}
function showPhoto() {
	document.getElementsByName("idcardPhoto")[0].value = "";
	photoChange("idcardPreview", "");
	exampleChange(1);
	if (document.getElementById("photoTable1").style.visibility=="hidden") {
		document.getElementById("photoTable1").style.visibility = "visible";
	}
	
	if (document.getElementById("photoTable2").style.display=="") {
		document.getElementById("photoTable2").style.display = "none";
	}
	if (document.getElementById("photoDiv").style.display=="none") {
		document.getElementById("photoDiv").style.display = "";
	}
}
function showPhotoBack() {
	document.getElementsByName("idcardPhoto")[0].value = "";
	photoChange("idcardPreview", "");
	exampleChange(2);
	if (document.getElementById("photoTable1").style.visibility=="hidden") {
		document.getElementById("photoTable1").style.visibility = "visible";
	}
	
	document.getElementsByName("backOfIdcardPhoto")[0].value = "";
	photoChangeback("backOfIdcardPreview", "");
	if (document.getElementById("photoTable2").style.display=="none") {
		document.getElementById("photoTable2").style.display = "";
	}
	
	if (document.getElementById("photoDiv").style.display=="none") {
		document.getElementById("photoDiv").style.display = "";
	}
}

function update() {
		AccountLogic.getCityList(createList, $("provSeq").value);
	}
	function createList(data) {
  		DWRUtil.removeAllOptions("citySeq");
  		DWRUtil.addOptions("citySeq", data,'cityId','cityName');
	}
	function id_keyup(txtinput) {
		txtinput.value=txtinput.value.replace(/(^\s*)|(\s*$)/g, "");
	}		
</SCRIPT>
<html:form action="submitIdcard.do" enctype="multipart/form-data">
	<html:hidden property="authenticationStatus" />
	<div id="main">
		<div class="content_right">
			<div style="width:745px;margin-left:10px;">
				<div class="titleinfo">
					身份证认证
				</div>
				<div class="edit_pass">
					<table width="100%" border="0" align="center" cellpadding="5"
						cellspacing="1">
						<tr>
							<td height="25" align="right">
							<input type="hidden" name="cardType" value="1" />
								<span class="orang12b">* </span>真实姓名：
							</td>
							<td>
								<label>
									<input type="text" name="idcardName" alt="真实姓名" maxlength="80"
										size="30" class="inputStyle" />
								</label>
							</td>
						</tr>
						<tr>
							<td height="25" align="right">
								<span class="orang12b">*</span> 身份证号码：
							</td>
							<td>
								<label>
									<input type="text" name="idcardNo" alt="身份证号码" maxlength="18"
										size="30" class="inputStyle" />
								</label>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top" height="25">
								<span class="orang12b">*</span> 银行卡号：
							</td>
							<td>
								<label>
									<input type="text" name="accountId" alt="银行卡号码" maxlength="32"
										size="30" styleClass="inputStyle" />
								</label>
								<br />
								<!-- 特别提醒 -->
								<table width="100%" border="0" align="center" cellpadding="7"
									cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
									<tr>
										<td bgcolor="#fffdf5">
											<table width="100%" border="0" cellpadding="3"
												cellspacing="0">
												<tr>
													<td width="3%" height="25" valign="top"
														style="border-bottom:1px solid #ccc;"></td>
													<td width="97%" align="left" class="red12b"
														style="border-bottom:1px solid #ccc;">
														特别提醒
													</td>
												</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														<span class="text9green"> 银行账号/银行卡号为数字，且长度应该在 <span
															class="redColor12px">6</span>位到 <span
															class="redColor12px">32</span>位之间！</span>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td height="25" align="right">
								<span class="orang12b">*</span> 所属银行：
							</td>
							<td>
									<div class="select">
									<div>
										<html:select property="bankInfoId" alt="所属银行">
											<%
											if ("A".equals(user.getAccountType())) {
											%>
											<ad:agileOptions typeid="BANK_INFO" dummyLabel="请选择" />
											<%
											} else if ("B".equals(user.getAccountType())) {
											%>
											<ad:agileOptions typeid="ENTERPRISE_BANK_INFO"
												dummyLabel="请选择" />
											<%
											}
											%>
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td align="right" height="25">
								<span class="orang12b">*</span> 开户行省份：
								<input type="hidden" name="CARD_TYPE" value="1"/> 
							</td>
							<td>
								<div class="select">
									<div>
										<html:select property="provSeq" onchange="update()"
											alt="开户行省份">
											<html:options collection="province" property="cityId"
												labelProperty="cityName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						<!-- 开户行城市 -->
						<tr>
							<td align="right" height="25">
								<span class="orang12b">*</span> 开户行城市：
							</td>
							<td>
								<div class="select">
									<div>
										<html:select property="citySeq" alt="开户行城市">
											<html:options collection="city" property="cityId"
												labelProperty="cityName" />
										</html:select>
									</div>
								</div>
							</td>
						</tr>
						
						<!-- 开户行 -->
						<tr>
							<td align="right" height="25">
								<span class="orang12b">*</span> 开户行：
							</td>
							<td>
								<label>
									<input type="text" name="bankName" alt="开户行" maxlength="80"
										size="30" class="inputStyle" />
								</label>
							</td>
						</tr>
						<tr>
							<td width="19%" height="25" align="right" valign="top">
								<span class="orang12b">*</span> 提交方式：
							</td>
							<td width="81%">
								<span class="font_blue"> <input type="radio"
										name="submitMethod" value="3B" checked onclick="hidePhoto();" />
									传真身份证复印件<br /> <input type="radio" name="submitMethod"
										value="3A" onclick="showPhoto();" style="border:0;" />
									上传旧版身份证扫描图片 <br /> <input type="radio" name="submitMethod"
										value="3A" onclick="showPhotoBack();" style="border:0;" />
									上传新版身份证扫描图片 </span>
							</td>
						</tr>
						<tr>
							<td height="25" colspan="2">
								<div id="photoDiv" style="display:none">

									<table id="photoTable1" style="visibility:hidden" width="100%"
										border="0" cellspacing="0" cellpadding="5">
										<tr>
											<td align="left">
												<span class="title"><img
														src="<%=path%>/images/addphoto.gif" width="21" height="20"
														align="absmiddle" /> 身份证正面图片：</span>
												<label>
													<html:file property="idcardPhoto"
														onchange="photoChange('idcardPreview',this.value)"
														size="45" styleClass="buttonStyle-nor inputStyle" />
												</label>
											</td>
										</tr>
										<tr>
											<td>
												<table width="450" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td align="center">
															<img id="idcardPreview" with="179" height="124" src="" />
														</td>
														<td align="center">
															<img id="example" src="<%=path%>/images/oldcard.jpg"
																border="0">
														</td>
													</tr>
													<tr>
														<td height="25" align="center">
															预览照片
														</td>
														<td align="center" id="exampleText">
															第一代身份证样例
														</td>
													</tr>
												</table>
												<label></label>
											</td>
										</tr>
									</table>
									<div id="photoTable2" style="display:none">
										<table width="100%" border="0" cellspacing="0" cellpadding="5">
											<tr>
												<td align="left">
													<span class="title"><img
															src="<%=path%>/images/addphoto.gif" width="21"
															height="20" align="absmiddle" /> 身份证背面图片：</span>
													<label>
														<html:file property="backOfIdcardPhoto"
															onchange="photoChangeback('backOfIdcardPreview',this.value)"
															size="45" styleClass="buttonStyle-nor inputStyle" />
													</label>
												</td>
											</tr>
											<tr>
												<td>
													<table width="450" border="0" cellspacing="0"
														cellpadding="0">
														<tr>
															<td align="center">
																<img id="backOfIdcardPreview" with="179" height="124"
																	src="" />
															</td>
															<td align="center">
																<img src="<%=path%>/images/newcard_2.jpg" border="0">
															</td>
														</tr>
														<tr>
															<td height="25" align="center">
																预览照片
															</td>
															<td align="center">
																第二代身份证样例（背面）
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</div>
								</div>
							</td>
						</tr>

						<tr>
							<td height="25" colspan="2">
								<table width="100%" border="0" cellpadding="5" cellspacing="0">
									<tr>
										<td align="left" class="font_blue">
											请根据您的现用身份证类型进行选择上传.
											<label></label>
										</td>
									</tr>
									<tr>
										<td align="left" class="font_blue">
											如果为旧版身份证,只需上传一张正面图片,新版身份证必须 上传正反面2张图片,否则不予审核通过。
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td height="25" colspan="2">
								<br />
								<table width="100%" border="0" align="center" cellpadding="7"
									cellspacing="1" bgcolor="#f9e277" style="margin:10px 0;">
									<tr>
										<td bgcolor="#fffdf5">
											<table width="100%" border="0" cellpadding="3"
												cellspacing="0">
												<tr>
													<td width="3%" height="25" valign="top"
														style="border-bottom:1px solid #ccc;"></td>
													<td width="97%" align="left" class="red12b"
														style="border-bottom:1px solid #ccc;">
														特别提醒
													</td>
												</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														真实姓名必须与身份证上的姓名一致。
													</td>
												</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														请将身份证正面扫描成一张
														<span class="redColor12px">gif</span>或者
														<span class="redColor12px">jpg</span>格式，大小不超过
														<span class="redColor12px">512KB</span>的图片上传给我们，或者稍后将身份证复印件传真至客服，传真号码
														<span class="text9green">xxx xxx xxxx</span>。
													</td>
												</tr>
												<tr>
													<td valign="top">
														&nbsp;
													</td>
													<td align="left" class="font_gray">
														我们将对您提交的身份证号码与您提交的身份证图片进行核对，审核结果会在
														<span class="redColor12px">3个工作日内</span>给出。
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<div class="button_Frame">
						<input type="button" name="sure" value="确 定" class="button_style"
							onclick="submitProcess();" />
						<input type="button" name="return" value="返 回"
							class="button_style"
							onclick="loading('<%=path%>/route.do?modual=space$account');" />
					</div>
				</div>
			</div>
		</div>
	</div>
</html:form>
